
class Animal:
    def eat(self):
        print("---eat---")

class Dog(Animal):
    pass

# 默认方法创建类
wangcai = Dog()
wangcai.eat()

# 通过type来创建有继承关系的类
Cat = type("Cat", (Animal, ), {})
xiaohuamao = Cat()
xiaohuamao.eat()

print(Animal.__class__) # <class 'type'>
print(Cat.__class__) # <class 'type'>
print(wangcai.__class__) # <class '__main__.Dog'>
print(xiaohuamao.__class__) # <class '__main__.Cat'>
print(Dog.__class__) # <class 'type'>
print(Cat.__class__) # <class 'type'>

print(type.__class__) # <class 'type'>
